qt_add_executable(exampleapp
    main.cpp
)

qt_add_qml_module(exampleapp
    URI QoolUIApp
    VERSION 1.0
    QML_FILES
        main.qml
        PageSelector.qml
        PageLoader.qml
        SelectionButton.qml
        TOC.qml
        pages/QoolPage.qml
        pages/PSpinBox.qml
        pages/PColorInput.qml
        pages/PWelcome.qml
        pages/PBasicButtons.qml
        pages/PTextInput.qml
        pages/PMenu.qml
        pages/PDialogs.qml
)

set_target_properties(exampleapp PROPERTIES
    MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

target_compile_definitions(exampleapp
    PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(exampleapp
    PRIVATE Qt6::Quick
)

add_custom_command(TARGET exampleapp POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/qml  $<TARGET_FILE_DIR:exampleapp>
)

add_dependencies(exampleapp
  Qool QoolComponents
  QoolControls QoolControlsBasic QoolControlsInputs
  QoolStyles
  QoolWindows QoolWindowsBasic)

